<?php

namespace App\Console;

use App\Console\Commands\SyncGoodsStockChangeAck;
use App\Console\Commands\StockoutOrderQueryTrade;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Console\Commands\SyncTradePush;
use App\Console\Commands\LogisticsSyncQuery;
use App\Console\Commands\LogisticsSyncAck;
use App\Console\Commands\SyncApiGoodsStockChangeQuery;
use App\Console\Commands\SyncGoodsPush;
use App\Console\Commands\SyncApiGoodsSpecPush;
use App\Console\Commands\SyncSuitesPush;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        SyncTradePush::class,
        SyncGoodsStockChangeAck::class,
        StockoutOrderQueryTrade::class,
        LogisticsSyncQuery::class,
        LogisticsSyncAck::class,
        SyncApiGoodsStockChangeQuery::class,
        SyncGoodsPush::class,
        SyncApiGoodsSpecPush::class,
        SyncSuitesPush::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('sync:wdt-logistics')->everyMinute();
        $schedule->command('sync:SuitesPush')->everyFiveMinutes();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
